<template>
  <manage-table
    :table-name="tableName"
    :service="service"
    :default-model="defaultModel"
    :table-options="options"
    ref="manageTable"></manage-table>
</template>

<script lang="ts">
  import ManageTable from '@/components/Table/ManageTable/index.vue';
  import { Options } from '@/components/Table/types';
  import { Role, roleService } from '@/services/authorization/Role';
  import { defineComponent } from 'vue';

  export default defineComponent({
    name: 'RoleTable',
    components: {
      ManageTable,
    },
    setup() {
      const tableName = 'role';
      const defaultModel: Partial<Role> = {
        id: undefined,
        code: undefined,
        remark: undefined,
        parent: [],
      };
      const options: Options<Role> = {
        code: {
          type: 'value',
          label: '角色编码',
        },
        remark: {
          type: 'value',
          label: '备注',
        },
      };
      return {
        tableName,
        service: roleService,
        defaultModel,
        options,
      };
    },
  });
</script>
